#ifndef BINDABLE_MEM_H_
#define BINDABLE_MEM_H_

namespace Bind
{
	/**
	 \class Mem
	 \brief Represents an object which can be dynamically allocated, and
	 needs to automatically be garbage-collected.
	 
	 Although the objects don't, in fact, automatically garbage collect, the
	 smart pointers to them (Refs) are able to do so.
	 */
	class Mem
	{
	public:
		Mem()
		{
			_refCount = 0;
		}
		
		void ref()
		{
			_refCount++;
		}
		
		int deref()
		{
			return --_refCount;
		}
		
		int refCount()
		{
			return _refCount;
		}
		
		virtual ~Mem() { }
	protected:
		int _refCount;
	};

}


#endif